//时间添加天数，返回字符串
//now
const addDaysToDate = (date,n) => {
    const d = new Date(date); //只要给个日期字符串，就能得到一个日期对象
    console.log(d);
    console.log(d.getDate());
    d.setDate(d.getDate() + n);
    // console.log(d.getDate());
    console.log(d.toISOString().split('T')[0],'///');
    return d.toISOString(); //ISO

}

addDaysToDate('2021-9-3',10);
// addDaysToDate('2021-9-3',-10);
